
import React from 'react'
import { TabNavigator, TabBarBottom } from 'react-navigation'
import HomeScreen from '../home/home'
import BulkScreen from '../bulk/bulk'
import CenterScreen from '../center/center'

import TabBarItem from '../../components/app/tabBarBottom'

import homeImgH from '../../../assets/images/tabbar/home_hl@3x.png'
import homeImg from '../../../assets/images/tabbar/home@3x.png'
import centerImgH from '../../../assets/images/tabbar/me_hl@3x.png'
import centerImg from '../../../assets/images/tabbar/me@3x.png'
import bulkImgH from '../../../assets/images/tabbar/bulk_hl@3x.png'
import bulkImg from '../../../assets/images/tabbar/bulk@3x.png'

const Tab = TabNavigator(
  {
    Home: {
      screen: HomeScreen,
      navigationOptions: ({ navigation }) => ({
        tabBarLabel: '首页',
        tabBarIcon: ({focused, tintColor}) => (
          <TabBarItem
            tintColor={tintColor}
            focused={focused}
            normalImage={homeImg}
            selectedImage={homeImgH}
          />
        )
      })
    },
    Bulk: {
      screen: BulkScreen,
      navigationOptions: ({ navigation }) => ({
        tabBarLabel: '冻品',
        tabBarIcon: ({focused, tintColor}) => (
          <TabBarItem
            tintColor={tintColor}
            focused={focused}
            normalImage={bulkImg}
            selectedImage={bulkImgH}
          />
        )
      })
    },
    Center: {
      screen: CenterScreen,
      navigationOptions: ({ navigation }) => ({
        tabBarLabel: '我',
        tabBarIcon: ({ focused, tintColor }) => (
          <TabBarItem
            tintColor={tintColor}
            focused={focused}
            normalImage={centerImg}
            selectedImage={centerImgH}
            />
          )
      })
    }
  },
  {
    tabBarComponent: TabBarBottom,
    tabBarPosition: 'bottom',
    swipeEnabled: false,
    animationEnabled: false,
    lazy: true,
    tabBarOptions: {
      activeTintColor: '#06c1ae',
      inactiveTintColor: '#979797',
      style: { backgroundColor: '#ffffff' },
      labelStyle: {
        fontSize: 14 // 文字大小
      }
    }
  }
  )

export default Tab
